Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 5 - Ink Objects / Ink Objects Reference
Functions / Creating and Manipulating Ink Objects


GXCopyToInk

You can use the GXCopyToInk function to create a copy of an existing ink object.

gxInk GXCopyToInk(gxInk target, gxInk source);
target
A reference to the ink object to copy the source contents into. If you specify nil for this parameter, the GXCopyToInk function creates a new ink object.
source
A reference to the ink object whose contents you want to copy.
function result
A reference to the copy (that is, the target ink).
DESCRIPTION
The GXCopyToInk function copies the contents of an existing ink object to another, or it creates a new ink object and copies the contents of an existing ink object to it. The function copies the color, transfer mode, attributes, and tag list (but not the owner count) of the ink object specified by the source parameter into the ink object specified by the target parameter. It clones, but does not copy, the tag objects in the tag list.

If you specify nil for the target parameter, the GXCopyToInk function creates a new ink object and copies the source properties, including owner count and tag list, into it.

You can use the GXCopyToInk function to create a copy of an ink object so you can modify it without changing the original.

SPECIAL CONSIDERATIONS
If you specify nil for the target parameter and no error occurs, the GXCopyToInk function creates an ink object; you are responsible for disposing of that object when you no longer need it.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
ink_is_nil 
SEE ALSO
To create a new ink that is a copy of the default ink instead of a copy of an existing ink, use the GXNewInk function, described on page 5-56.

To compare two ink objects, use the GXEqualInk function, described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996